package org.bluedream.core.module.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.bluedream.comm.base.PageEntity;
import org.bluedream.comm.fill.annotation.FillType;
import org.bluedream.comm.fill.annotation.TargetField;

import java.util.List;

@ToString(callSuper = true)
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName(value = "sys_role")
public class Role extends PageEntity<Role> {
    private static final long serialVersionUID = -8298466748634047203L;
    @Setter
    @Getter
    @NonNull
    private String roleCode;
    @Setter
    @Getter
    @NonNull
    private String roleName;
    @Setter
    @Getter
    private String roleType;
    @Setter
    @Getter
    private Integer roleSort;
    @Setter
    @Getter
    @NonNull
    private String isSys;
    @Setter
    @Getter
    private String userType;
    @Setter
    @Getter
    private String dataScope;
    @TableField(exist = false)
    public static final int DEFAULT_SORT = 30; //默认排序 数值
    @TableField(exist = false)
    public static final int SORTS_LENGTH = 10; //排序递增值
    @TableField(exist = false)
    @Setter
    @Getter
    private String userId;
    @TableField(exist = false)
    @Setter
    @Getter
    private String orgId;

    @Setter
    @Getter
    @TableField(exist = false)
    private List<Menu> menus;

    @Setter
    @Getter
    @TableField(exist = false)
    private List<String> idList;

    @Setter
    @Getter
    @TableField(exist = false)
    private List<User> users;

    @Setter
    @Getter
    @TableField(exist = false)
    private List<Organization> organizations;

    public Role(String id) {
        this.id = id;
    }

    public Role(long limit , long pageSize) {
        this.limit = limit;
        this.page = pageSize;
    }
}
